<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <!-- 生活委员 -->
    <title>班级寝室</title>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
	<link rel="stylesheet" type="text/css" href="css/f/navs.css">
	<link rel="stylesheet" type="text/css" href="css/f/default.css">
	<link rel="stylesheet" type="text/css" href="css/f/assignment.css"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
	<script src="js/f/cadrelife.js"></script>
	<script src="js/jquery.js"></script>
</head>

<body>
	<div class="all">
		<jsp:include page="/nav.jsp"></jsp:include>
        <div class="rightall float-left">
        	 	<div class="already">
	                <div class="already-title">
	        			<div class="left">查看班级寝室</div>
	        			<input type="hidden" value="${error_msg }" name="errorMsg" />
	        		</div>
       			</div>
	            <table>
  					<tr class="tr-style-head">
  						<td>序号</td>
  						<td>班级名称</td>
	  					<td>寝室名称</td>
	  					<td>添加时间</td>
	  					<td>寝室状态</td>
  					</tr>
  					<c:forEach items="${drom }" var="d" varStatus="vs">
  					<tr class="tr-style">
  						<td>${vs.count}</td>
  						<td>${d.className }</td>
  						<td>${d.dormName }</td>
	  					<td>
	  						<fmt:formatDate value="${d.createTime }" pattern="yyyy年MM月dd日"/>
	  					</td>
	  					<td>
	  					<c:if test="${d.classDormState==1 }">正常</c:if>
	  					<c:if test="${d.classDormState==2 }"><span style="color:red;">冻结</span></c:if>
	  					</td>
  					</tr>
  					</c:forEach>
				</table>
              <c:if test="${pages > 1 }">
               		<div class="previous">
	               		<c:if test="${pageNo>1}">
  				   		<a href="cadre/dorms.do?pageNo=${pageNo-1}">上一页</a>
	                	</c:if>
	                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
	                   		<c:if test="${p==pageNo }">
	                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
	                   		</c:if>
	                   		<c:if test="${p!=pageNo }">
	                   			<a href="cadre/dorms.do?pageNo=${p}" >&nbsp;${p}&nbsp;</a>
	                   		</c:if>
	                   	</c:forEach>
	                    <c:if test="${pageNo<pages}">
						<a href="cadre/dorms.do?pageNo=${pageNo+1}">下一页</a>	   
		             	</c:if>
                   </div>
                </c:if>	
       	</div>		
 	 </div>
</body>
</html>
